import java.util.Scanner;

class Person{
	private String name = null;
	private int age = 0;
	private boolean gender = false;
	private int id = 0;
	
	public Person() {
		System.out.println("This is constructor");
		System.out.println(name+","+age+","+gender+","+id);
		System.out.println("Person [name="+name+", age="+age+", gender="+gender+", id="+id+"]");
	}
	
	public Person(String n, int a, boolean g) {
		this.name = n;
		this.age = a;
		this.gender = g;
	}
	
	public String toString() {
		System.out.println("Person [name="+this.name+", age="+this.age+", gender="+this.gender+", id="+0+"]");
		return name;
	}
}

public class First {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner reader = new Scanner(System.in);
		int number = reader.nextInt();
		Person[] per = new Person[number];	
		for(int i=0; i<per.length; i++) {	
			String name = reader.next();
			int age = reader.nextInt();
			boolean genter = reader.nextBoolean();
			per[i] = new Person(name,age,genter);
		}
		for(int x=per.length-1; x>=0;x--){	
			per[x].toString();
		}
		
		per.toString();
		@SuppressWarnings("unused")
		Person s = new Person();
	}

}
